var eprogressBar = document.createElement("span");
eprogressBar.id = "eprogress";
var html = document.getElementsByTagName("html")[0];
var width=html.clientWidth;
html.appendChild(eprogressBar);
var bar = document.getElementById("eprogress");
var timer = setInterval(function(){
	var w =bar.clientWidth;
	bar.style.width  = w + Math.floor(Math.random()*10+1) + "px";
	if(w>=width){
		clearInterval(timer);
	}
},100)

window.onload = window.onunload = function(){
	setTimeout(function(){
	// eprogressBar.remove();
		var t = setInterval(function(){
			var w = bar.clientWidth;
			bar.style.width  = w + 30 + "px";
			if(w>=width){
				clearInterval(t);
				clearInterval(timer);
				setTimeout(bar.remove(), 3000);
			}
		},10)
	},0);
}